﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ColladaDotNet.Geometry;
using Microsoft.DirectX;

namespace BakalarskaPraca.Generation.Data
{
    public class ModelGeometry
    {
        public List<Polygon> Polygons;
        public List<Vector3> Vertices;
        public string Name;
        public ModelGeometry(Geometry geometry)
        {
            this.Polygons = new List<Polygon>();
            geometry.Meshes.ForEach(mesh => mesh.Primitives.ForEach(
                primitive => this.Polygons.AddRange(primitive.Polygons)));
            this.Vertices = new List<Vector3>(geometry.Vertices.Select(v => v.Positions[0].Vector));
            this.Name = geometry.Id;
        }
    }
}
